#pragma once 

#include "ColligereSearchFreeDb.hpp"

extern const wxEventType COLLIGERE_CMD_VOLGETTER_THREAD_COMPLETED;

class ColligereSearchFreeDbPanel : public wxPanel, public wxThreadHelper
{
public:
	virtual ~ColligereSearchFreeDbPanel() { }
	void Initialize();
protected:
	virtual wxThread::ExitCode Entry();
private:
	ColligereSearchFreeDbPanel();

	col::SearchFreeDb mFreeDbSearcher;
	std::map < wxUint32, col::SearchFreeDb::SearchResult > mCurSearchResults;
	col::string_deque mMountedDrives;

	void OnDeviceSelected ( wxCommandEvent &rEvt );
	void OnDeviceTextUpdated ( wxCommandEvent &rEvt );
	void OnButtonSearch ( wxCommandEvent &rEvt );
	void OnSearchResultDClick ( wxCommandEvent &Evt );

	void OnThreadCompleted ( wxCommandEvent &rEvt );
	void OnClose ( wxCloseEvent &rEvt );

	DECLARE_DYNAMIC_CLASS ( ColligereSearchFreeDbPanel );
	DECLARE_EVENT_TABLE()
};
